package com.xjm.bean.definition;

import com.AnnotationContextDemo;
import org.springframework.beans.factory.annotation.AnnotatedGenericBeanDefinition;
import org.springframework.context.annotation.AnnotationConfigUtils;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.core.annotation.AnnotationAttributes;
import org.springframework.core.type.AnnotationMetadata;
import org.springframework.core.type.StandardAnnotationMetadata;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.Map;

/**
 * @author jaymin
 * 2021/1/6 20:51
 */
public class AnnotatedGenericBeanDefinitionDemo {

	public static void main(String[] args) {
		AnnotationMetadata standardAnnotationMetadata = new StandardAnnotationMetadata(AnnotationContextDemo.class);
		Map<String, Object> annotationAttributes = standardAnnotationMetadata.getAnnotationAttributes(ComponentScan.class.getName());
		System.out.println(Arrays.toString(((String[]) annotationAttributes.get("basePackages"))));
	}
}
